package com.business.leaf.api.controller;

import com.business.leaf.core.segment.domain.aggregate.SegmentManager;
import com.business.leaf.core.segment.service.LeafService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName LeafController
 * @Description TODO
 * @Author lgh
 * @Date 2020-04-09 11:07
 */
@RestController("/leaf")
public class LeafController {

    @Autowired
    LeafService leafService;

    @GetMapping("getId")
    public long getIdByTag(String tag){
        return leafService.getIdByTag(tag);
    }

    @GetMapping("putLeaf")
    public String putLeaf(String bizTag,long step,String description){
        return leafService.insertLeafAlloc(bizTag,step,description);
    }

}
